<!DOCTYPE html>
<html>
<head>
<%include("../../tpl/head_form.html"){}%>
<title>后台管理-发送消息</title>
</head>
<body class="sidebar-mini fixed skin-blue">
	<div class="wrapper">
		<!-- 头部 -->
		<%include("../../tpl/header.html",{menus:menus}){}%>
		<!-- 网页正文 -->
		<div class="content-wrapper">
			<!-- 网页正文-面包屑 -->
			<div class="content-header">
				<h1>发送消息</h1>
				<ol class="breadcrumb">
					<li><a href="/admin/index.jspx"><i class="fa fa-dashboard"></i> 后台系统</a></li>
					<li><a href="#">通知消息</a></li>
					<li class="active">发送消息</li>
				</ol>
			</div>
			<!-- 网页正文-主体 -->
			<section class="content">
				<div class="row">
					<div class="col-md-12">
						<div class="box box-info">
							<div class="box-header with-border">
								<h3 class="box-title"></h3>
							</div>
							<form class="form-horizontal" action="send.json">
								<div class="box-body">
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">收信人</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<select class="form-control select2" multiple name="account" data-placeholder="请选择收信人" data-ajax--url="getUser.json" data-ajax--delay="500" data-cache="true" data-language="zh-CN" style="width: 100%" required></select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">标题</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<input type="text" class="form-control" name="title" placeholder="请输入标题" required>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">消息类型</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<select class="form-control" name="type">
												<!-- <% for(a in types){%> -->
												<option value="${a.code!}">${a.text!}</option>
												<!-- <%}%> -->
											</select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">发送时间</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<input type="text" class="form-control" name="sendTime" readonly placeholder="点击选择发送时间" data-laydate data-format="YYYY/MM/DD hh:mm:ss" data-istime="true" data-min='${date(),"yyyy/MM/dd HH:mm:ss"}' required>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">连接地址</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<input type="text" class="form-control" name="link" placeholder="请输入连接地址">
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">消息主体</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<textarea class="form-control" rows="3" name="content" placeholder="请输入消息主体" required></textarea>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-2 col-md-3 col-sm-4 control-label">消息附带参数</label>
										<div class="col-lg-4 col-md-6 col-sm-8">
											<input type="text" class="form-control" name="param" placeholder="请输入消息附带参数">
										</div>
									</div>
								</div>
								<!-- /.box-body -->
								<div class="box-footer">
									<div class="row">
										<div class="col-lg-4 col-md-6 col-sm-8 col-lg-offset-2 col-md-offset-3 col-sm-offset-4">
											<button type="button" class="btn btn-default">取消</button>
											<button type="submit" class="btn btn-info pull-right">发送</button>
										</div>
									</div>
								</div>
								<!-- /.box-footer -->
							</form>
						</div>
					</div>
				</div>
			</section>
			<!-- /.content -->
		</div>
		<!-- 网页底部 -->
		<%include("../../tpl/footer.html"){}%>
	</div>
	<%include("../../tpl/script_form.html"){}%>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".select2").select2();
			$("form").validate({
				ignore : ".ignore",
				errorElement : "em",
				errorPlacement : function(error, element) {
					error.addClass("help-block");
					element.parent().append(error);
				},
				highlight : function(element, errorClass, validClass) {
					$(element).parents(".form-group").addClass("has-error");
				},
				unhighlight : function(element, errorClass, validClass) {
					$(element).parents(".form-group").removeClass("has-error");
				},
				submitHandler : function(form) {
					Ajax.post($(form).attr('action'), $(form).serialize(), function(result) {
						form.reset();
						layer.msg("发送成功", {
							icon : 1,
							time : 1500
						});
					});
				}
			});
		});
	</script>
</body>
</html>
